package com.snow.datasource.config;

import com.snow.datasource.healths.MasterSlaveEndpoint;
import com.snow.datasource.healths.MasterSlaveHealth;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @Description
 * @Author fanxl
 * @Date 2020/12/24
 **/
public class HealthConfig {

    @Bean
    public MasterSlaveHealth getMasterSlaveHealth(){
        return new MasterSlaveHealth();
    }
    @Bean
    @ConditionalOnClass(MasterSlaveHealth.class)
    @ConditionalOnMissingBean
    public MasterSlaveEndpoint getMasterSlaveEndpoint(){
        return new MasterSlaveEndpoint();
    }
}
